﻿using Microsoft.Extensions.DependencyInjection;
using PLCS.App.ProcessSolution.ViewModels.Process;
using PLCS.App.ProcessSolution.ViewModels.Solution;
using PLCS.App.ProcessSolution.Views.Process;
using PLCS.App.ProcessSolution.Views.Solution;
using Prism.Ioc;
using Prism.Modularity;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;

namespace PLCS.App.ProcessSolution;

[DependsOn(typeof(AbpAutoMapperModule))]
public class ProcessSolutionModule : AbpModule, IModule
{
    public void OnInitialized(IContainerProvider containerProvider)
    {
    }

    public void RegisterTypes(IContainerRegistry containerRegistry)
    {
        containerRegistry.RegisterForNavigation<SolutionView, SolutionViewModel>();
        containerRegistry.RegisterForNavigation<SolutionDetailView, SolutionDetailViewModel>();

        containerRegistry.RegisterForNavigation<ProcessView, ProcessViewModel>();
        containerRegistry.RegisterForNavigation<ProcessDetailView, ProcessDetailViewModel>();
    }

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddAutoMapperObjectMapper<ProcessSolutionModule>();

        Configure<AbpAutoMapperOptions>(options =>
        {
            options.AddMaps<ProcessSolutionModule>();
        });
    }
}